3.1.5 \(\int x \sqrt {\sin ^2(x)} \, dx\) [5]

Optimal. Leaf size=22 \[ \sqrt {\sin ^2(x)}-x \cot (x) \sqrt {\sin ^2(x)} \]

[Out]

(sin(x)^2)^(1/2)-x*cot(x)*(sin(x)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {6852, 3377, 2717} \begin {gather*} \sqrt {\sin ^2(x)}-x \sqrt {\sin ^2(x)} \cot (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*Sqrt[Sin[x]^2],x]

[Out]

Sqrt[Sin[x]^2] - x*Cot[x]*Sqrt[Sin[x]^2]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 6852

Int[(u_.)*((a_.)*(v_)^(m_.))^(p_), x_Symbol] :> Dist[a^IntPart[p]*((a*v^m)^FracPart[p]/v^(m*FracPart[p])), Int
[u*v^(m*p), x], x] /; FreeQ[{a, m, p}, x] &&  !IntegerQ[p] &&  !FreeQ[v, x] &&  !(EqQ[a, 1] && EqQ[m, 1]) &&
!(EqQ[v, x] && EqQ[m, 1])

Rubi steps

\begin {align*} \int x \sqrt {\sin ^2(x)} \, dx &=\left (\csc (x) \sqrt {\sin ^2(x)}\right ) \int x \sin (x) \, dx\\ &=-x \cot (x) \sqrt {\sin ^2(x)}+\left (\csc (x) \sqrt {\sin ^2(x)}\right ) \int \cos (x) \, dx\\ &=\sqrt {\sin ^2(x)}-x \cot (x) \sqrt {\sin ^2(x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 16, normalized size = 0.73 \begin {gather*} (1-x \cot (x)) \sqrt {\sin ^2(x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*Sqrt[Sin[x]^2],x]

[Out]

(1 - x*Cot[x])*Sqrt[Sin[x]^2]

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 0.10, size = 75, normalized size = 3.41

method result size
risch \(-\frac {i \sqrt {-\left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}\, {\mathrm e}^{2 i x} \left (x +i\right )}{2 \left ({\mathrm e}^{2 i x}-1\right )}-\frac {i \sqrt {-\left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}\, \left (x -i\right )}{2 \left ({\mathrm e}^{2 i x}-1\right )}\) \(75\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(sin(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*I*(-(exp(2*I*x)-1)^2*exp(-2*I*x))^(1/2)/(exp(2*I*x)-1)*exp(2*I*x)*(x+I)-1/2*I*(-(exp(2*I*x)-1)^2*exp(-2*I
*x))^(1/2)/(exp(2*I*x)-1)*(x-I)

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 9, normalized size = 0.41 \begin {gather*} x \cos \left (x\right ) - \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(sin(x)^2)^(1/2),x, algorithm="maxima")

[Out]

x*cos(x) - sin(x)

________________________________________________________________________________________

Fricas [A]
time = 1.74, size = 8, normalized size = 0.36 \begin {gather*} -x \cos \left (x\right ) + \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(sin(x)^2)^(1/2),x, algorithm="fricas")

[Out]

-x*cos(x) + sin(x)

________________________________________________________________________________________

Sympy [A]
time = 0.21, size = 24, normalized size = 1.09 \begin {gather*} - \frac {x \sqrt {\sin ^{2}{\left (x \right )}} \cos {\left (x \right )}}{\sin {\left (x \right )}} + \sqrt {\sin ^{2}{\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(sin(x)**2)**(1/2),x)

[Out]

-x*sqrt(sin(x)**2)*cos(x)/sin(x) + sqrt(sin(x)**2)

________________________________________________________________________________________

Giac [A]
time = 0.39, size = 15, normalized size = 0.68 \begin {gather*} -x \cos \left (x\right ) \mathrm {sgn}\left (\sin \left (x\right )\right ) + \mathrm {sgn}\left (\sin \left (x\right )\right ) \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(sin(x)^2)^(1/2),x, algorithm="giac")

[Out]

-x*cos(x)*sgn(sin(x)) + sgn(sin(x))*sin(x)

________________________________________________________________________________________

Mupad [B]
time = 2.63, size = 48, normalized size = 2.18 \begin {gather*} \sqrt {{\left (\frac {{\mathrm {e}}^{-x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )}^2}-x\,\mathrm {cot}\left (x\right )\,\sqrt {{\left (\frac {{\mathrm {e}}^{-x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(sin(x)^2)^(1/2),x)

[Out]

(((exp(-x*1i)*1i)/2 - (exp(x*1i)*1i)/2)^2)^(1/2) - x*cot(x)*(((exp(-x*1i)*1i)/2 - (exp(x*1i)*1i)/2)^2)^(1/2)

________________________________________________________________________________________